//
//  UIViewController+XBWebSupport.h
//  XBFrameworkProject
//
//  Created by 徐秀滨 on 2018/11/12.
//  Copyright © 2018年 徐秀滨. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>

@protocol WKDelegate <NSObject>

- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message;

@end

@interface WKDelegateController : UIViewController <WKScriptMessageHandler>

@property (weak , nonatomic) id<WKDelegate> delegate;

@end

@interface UIViewController (XBWebSupport)<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,WKDelegate,UIWebViewDelegate>

@property (nonatomic,strong) WKWebView *wkWebView;
@property (nonatomic, strong) WKUserContentController *userContentController;
@property (nonatomic, strong) NSString *webScriptName;
@property (nonatomic, strong) UIProgressView *progressView;

- (void)initWeb;

//根据url地址加载html页面
- (void)loadWithUrl:(NSString *)urlString;

//根据本地html文件名加载html页面
- (void)loadWithHtmlName:(NSString *)htmlName;

@end
